<div class="modal-header">
    <button type="button" class="close" ng-click="$dismiss()">&times;</button>
    <h3 class="modal-title">创建环节</h3>
</div>
<div class="modal-body">
    <form name="stageForm" role="form" class="form-horizontal">
        <div class="form-group">
            <label for="stageTitle" class="col-sm-1 field-desc">名称<span
                    class="thiki-form-required">*</span></label>

            <div class="col-sm-10">
                <input id="stageTitle" name="stageTitle" type="text" class="form-control" data-ng-model="stage.title"
                       focus="true" placeholder="名称" autocomplete="off" maxlength="30" required/>

                <div class="validation-error-message"
                     ng-show="stageForm.stageTitle.$error.required && stageForm.stageTitle.$dirty">
                    环节名称不能为空
                </div>
            </div>
        </div>

        <div class="form-group">
            <label for="stageDescription" class="col-sm-1 field-desc">描述</label>
            <div class="col-sm-10">
                <textarea id="stageDescription" name="stageDescription" rows="3" ng-maxlength="100"
                          class="form-control ng-pristine ng-valid ng-valid-required ng-touched"
                          data-ng-model="stage.description" focus="true" placeholder="相关描述说明"
                          autocomplete="off"></textarea>
            </div>
        </div>

        <div class="form-group" ng-hide="stage.archived">
            <label for="stageType" class="col-sm-1 field-desc">类型<span
                    class="thiki-form-required">*</span></label>
            <div class="col-sm-4" id="stageType">
                <ui-select data-ng-model="types.selected" name="stageType" required>
                    <ui-select-match placeholder="选择类型">{{$select.selected.name}}</ui-select-match>
                    <ui-select-choices repeat="type in types | filter: $select.search">
                        <span ng-bind-html="type.name | highlight: $select.search"></span>
                    </ui-select-choices>
                </ui-select>
            </div>
            <label for="stageStatus" class="col-sm-1  field-desc">状态<span class="thiki-form-required">*</span></label>
            <div class="col-sm-4" id="stageStatus">
                <ui-select data-ng-model="statusList.selected" name="stageStatus" required>
                    <ui-select-match placeholder="选择类型">{{$select.selected.name}}</ui-select-match>
                    <ui-select-choices repeat="status in statusList | filter: $select.search">
                        <span ng-bind-html="status.name | highlight: $select.search"></span>
                    </ui-select-choices>
                </ui-select>
            </div>
        </div>
        <div class="form-group">
            <label for="WIPLimit" class="col-sm-1  field-desc">限额</label>
            <div class="col-sm-10">
                <input id="WIPLimit" class="form-control" type="number" name="WIPLimit" ng-model="stage.wipLimit"
                       min="1" max="99">
                <div class="field-tip">
                    <span class="glyphicon glyphicon-question-sign" aria-hidden="true"
                          uib-tooltip="限制在制品数量是看板开发方法的核心机制,用于产生拉动效应和暴露瓶颈，其值可以通过不断调整达到最优。" tooltip-placement="right"
                          tooltip-trigger="mouseenter"></span></div>
            </div>
        </div>
    </form>
</div>
<div class="modal-footer">
    <button class="btn btn-primary" type="button" ng-click="saveStage()"
            ng-disabled="stageForm.$invalid||isDisableStageSaveButton">
        {{stageSaveButton}}
    </button>
</div>